/// @tags: FWT
#include <cstdio>
#include <iostream>

using namespace std;

namespace BlueQuantum {

typedef long long LL;

int const M = 21, N = (1 << M) + 5;

int m, n;
char s[N], t[N];
LL a[N], b[N], c[N];

inline void FWT(LL f[], int typ) {
  for (int len = 1; len < n; len <<= 1) {
    for (int i = 0; i < n; i += len << 1) {
      for (int j = 0; j < len; j++) {
        f[i + j + len] += typ * f[i + j];
      }
    }
  }
}

inline int main() {
  cin >> m >> s >> t;
  n = 1 << m;
  for (int i = 0; i < n; ++i) {
    a[i] = (LL)(s[i] - '0') << (LL)(__builtin_popcount(i) << 1LL);
  }
  for (int i = 0; i < n; ++i) {
    b[i] = (LL)(t[i] - '0') << (LL)(__builtin_popcount(i) << 1LL);
  }
  FWT(a, 1);
  FWT(b, 1);
  for (int i = 0; i < n; ++i) c[i] = a[i] * b[i];
  FWT(c, -1);
  for (int i = 0; i < n; ++i)
    cout << char((c[i] >> (__builtin_popcount(i) << 1LL) & 3) + '0');
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("CF1034E Little C Loves 3 III.in", "r", stdin);
  freopen("CF1034E Little C Loves 3 III.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
